//
//  StagingDataV2.m
//  sr01sdkProject
//
//  Created by Linktop on 2022/8/16.
//

#import "StagingDataV2.h"

@implementation StagingDataV2

+ (NSDictionary *)mj_objectClassInArray

{

    return @{@"ousideStagingList": @"StagingSubObj", };

}

/// 转换字典数组为对象数组给外部使用
-(void)transStagingListToOuside
{
    self.ousideStagingList = [NSMutableArray new];
    
    [self.stagingList enumerateObjectsUsingBlock:^(NSMutableDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        StagingSubObj *subObj = [[StagingSubObj alloc]initWithDict:obj];
        if (subObj.list.count) {
            [self.ousideStagingList addObject:subObj];
        }
    }];
    
    for(int i = 0; i < self.ousideStagingList.count; i++) {
        StagingSubObj *subObj = self.ousideStagingList[i];
        if (i < self.ousideStagingList.count - 1) {
            [subObj.list addObject:self.ousideStagingList[i+1].list.firstObject];
        }
        
    }
    self.stagingList = nil;
    
}


@end
